<?php

$this->menu=array(
	array('label'=>'Create cargo', 'url'=>array('create')),
	array('label'=>'List cargo','url'=>array('list')),
);
$this->rmenu=array(
	array('label'=>'Create company', 'url'=>array('/company/create')),
);
?>

<h2>Choose <?php echo (!$params['company'])?"Shipper/Supplier":"Consignee";?></h2>

<div class="row">
	<?php echo CHtml::activeLabelEx($model,'searchText'); ?>
	<?php echo CHtml::activeTextField($model,'searchText'); ?>
</div>

<?php $this->widget('application.widgets.jui.SimpleCListView', array(
	'dataProvider'=>$model->search(),
	'params'=>$params,
	'itemView'=>'_viewcompany',
)); ?>
<?php
$cs = Yii::app()->getClientScript();
$searchURL = CHtml::normalizeUrl(array());

$script =<<<EOD
$('input#company_searchText').keypress(function(event){
	if(event.keyCode == '13'){
		$.fn.yiiListView.update('yw0',{data:{searchText:$(this).val()}});
	}
});
EOD;
$cs->registerScript("packageScript",$script,CClientScript::POS_END);
?>